package org.act.bpel2automata.views.model;

import java.util.ArrayList;
import java.util.List;

public class EntityElement implements ITreeElement {
	private String name;
	private List<ITreeElement> list = new ArrayList<ITreeElement>();
	private Object from = null;
	
	public EntityElement(String name){
		this.name = name;
	}
	
	public EntityElement(String name,Object from){
		this.name = name;
		this.from = from;
	}
	
	
	@Override
	public void addChild(ITreeElement treeElement) {
		// TODO Auto-generated method stub
		this.list.add(treeElement);
	}

	@Override
	public List<ITreeElement> getChildren() {
		// TODO Auto-generated method stub
		return list;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return this.name;
	}
	
	@Override
	public Object getFrom(){
		// TODO Auto-generated method stub
		return this.from;
	}
	
	@Override
	public boolean hasChildren() {
		// TODO Auto-generated method stub
		if(this.list.size() > 0){
			return true;
		}
		else
			return false;
	}

	@Override
	public void setChildren(List<ITreeElement> children) {
		// TODO Auto-generated method stub
		this.list = children;
	}

	@Override
	public void setName(String name) {
		// TODO Auto-generated method stub
		this.name = name;
	}

	@Override
	public void setFrom(Object from){
		// TODO Auto-generated method stub
		this.from = from;
	}
}
